package com.example.permission.myjbm.view;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.GridView;

/**
 * Created by JBMhaier on 2017/2/21.
 */

public class MeauseGridView extends GridView{
    public MeauseGridView(Context context) {
        super(context);
        setNumColumns(3);
    }

    public MeauseGridView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public MeauseGridView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }
    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        heightMeasureSpec= MeasureSpec.makeMeasureSpec((1<<30)-1,MeasureSpec.AT_MOST);
        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
//        setMeasuredDimension(widthMeasureSpec, heightMeasureSpec);
    }
}
